package com.zhou.yygh.hosp.controller;


import com.zhou.yygh.common.result.Result;
import com.zhou.yygh.hosp.service.DepartmentService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import zhou.hospital.vo.hosp.DepartmentVo;

import java.util.List;

@RestController
@RequestMapping("/admin/hosp/department")
@Api(tags = "部门管理")
public class DepartmentController {
    @Autowired
    private DepartmentService departmentService;


    @ApiOperation(value = "查询医院所有科室列表")
    @GetMapping("/getDeptList/{hoscode}")
    public Result getDeptList(@PathVariable String hoscode) {
        List<DepartmentVo> list = departmentService.getDeptTree(hoscode);
        return Result.ok(list);
    }
}
